getOrThrow

inline fun <T> Array<out T>.getOrThrow(index: Int, message: Array<out T>.(Int) -> String): T(source)

An alternative to the Array.get function that throws an exception with the provided message.


inline fun <T> List<T>.getOrThrow(index: Int, message: List<T>.(Int) -> String): T(source)

An alternative to the List.get function that throws an exception with the provided message.


inline fun <K, V> Map<K, V>.getOrThrow(key: K, message: Map<K, V>.(K) -> String): V(source)

An alternative to the Map.get function that throws an exception with the provided message.